<?php
namespace app\index\model;

use think\Model;

class Roles extends Model
{
    protected $table = 'roles';

    public function cards()
    {
        // return $this->hasOne('Cards', 'role_id')->field('id, code, role_id')->bind([
        //     'code',
        //     'code_id' => 'id'
        // ]);

    }

    public function friends()
    {
        return $this->hasMany('Friends', 'role_id')->field('id, name, money, role_id');
    }

}